<template>
	<image src="http://8.146.208.139:3000/img_test/bg.png" alt="" class="bg" />
	<view class="headimg">
		<van-image round width="8rem" height="8rem" :src="avator ? avator : 'https://img.yzcdn.cn/vant/cat.jpeg'"
			custom-class="my-custom-class" @click="getimg" />
	</view>
</template>

<script>
	export default {
		props: ['avator'],
		methods: {
			getimg() {
				uni.chooseImage({
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album', 'camera'], //从相册选择
					success: (res) => {
						// console.log(res)
						const tempFilePath = res.tempFilePaths[0];
						this.url = tempFilePath;
						console.log(tempFilePath)
					},
					fail: (err) => {
						console.log(err)
					}
				})
			}
		}
	}
</script>

<style scoped>
	.bg {
		width: 100%;
		height: 1103rpx;
		position: absolute;
		z-index: 0;
	}

	.headimg {
		position: relative;
		padding-top: 20%;
		text-align: center;
	}
</style>